// TimeSpanTest.h: interface for the TimeSpanTest class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TIMESPANTEST_H__FF13B149_6045_43DD_9E95_1D95B601ED91__INCLUDED_)
#define AFX_TIMESPANTEST_H__FF13B149_6045_43DD_9E95_1D95B601ED91__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class TimeSpanTest  
{
public:
	double stop5();
	void stop4(const char*text);
	void stop3(const char*text);
	void stop2(const char*text);
	double getSpan()const
	{
		LARGE_INTEGER f;
		if(QueryPerformanceFrequency(&f))
		{
			return (m_t2-m_t1)/(double)f.QuadPart;
		}
		return 0;
	}
	static __int64 getSysCounter()
	{
		LARGE_INTEGER time;
		BOOL rt=QueryPerformanceCounter(&time);
		__int64 t;
		t=(__int64)time.QuadPart;
		return t;
	}
	__int64 stop()
	{
		m_t2=getSysCounter();
		m_dt=m_t2-m_t1;
		return m_dt;
	}
	void begin()
	{
		m_t1=getSysCounter();
	}
	TimeSpanTest(){begin();}
	virtual ~TimeSpanTest(){}
protected:
	__int64 m_t1,m_t2;
	__int64 m_dt;
};

#endif // !defined(AFX_TIMESPANTEST_H__FF13B149_6045_43DD_9E95_1D95B601ED91__INCLUDED_)
